package com.atguigu.guli.service.edu.controller.admin;

import com.atguigu.commonutils.result.BaseResult;
import com.atguigu.commonutils.result.R;
import org.springframework.web.bind.annotation.*;

import javax.xml.transform.Result;

/**
 * @author: Mr.Wang
 * @date: 2021-05-15 11:44
 * @description:
 */
@CrossOrigin
@RestController
@RequestMapping("/user")
public class LoginController {
    //登录
    @PostMapping("login")
    public R login() {
        return R.ok().data("token","admin");
    }

    //获取用户信息
    @GetMapping("/info")
    public R info() {
        return R.ok().data("roles","[admin]")
                .data("name","admin")
                .data("avatar","https://oss.aliyuncs.com/aliyun_id_photo_bucket/default_handsome.jpg");
    }
    //退出登录
    @PostMapping("/logout")
    public R logout() {
        return R.ok();
    }
}
